function Visa(doc, container, width, height, user, date, options, data) {
  this._doc = doc;
  this._container = container;
  this._width = width;
  this._height = height;
  this._user = user;
  this._date = date;
  this._options = options;
  this._data = data;
  
  this._unique = MiscUtils.unique();
  this._createElements();
  this._gui = AbsVisa.gui(this._unique);
};

Visa.prototype._createElements = function() {
  var table, tr, td, input, itable, itr, itd, iitable;
  
  this._container.align = 'left';
  
  table = document.createElement('table');
  table.cellPadding = 0;
  table.cellSpacing = 0;
  table.style.padding = '10px 0';
  table.style.color = '#17183e';
  table.style.fontSize = '10pt';
  this._container.appendChild(table);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.verticalAlign = 'top';
  
  itable = document.createElement('table');
  itable.cellPadding = 0;
  itable.cellSpacing = 0;
  itable.style.fontWeight = 'bold';
  td.appendChild(itable);
  
  itr = itable.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.style.width = '170px';
  itd.style.padding = '6px 10px';
  itd.style.textAlign = 'right';
  itd.appendChild(document.createTextNode('Client No.'));
  itd = itr.insertCell(-1);
  itd.style.height = '25px';
  input = document.createElement('input');
  input.type = 'text';
  input.style.width = '260px';
  input.id = this._unique + '_client_num_text';
  itd.appendChild(input);
  
  itr = itable.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.style.padding = '6px 10px';
  itd.style.textAlign = 'right';
  itd.appendChild(document.createTextNode('Current Visa’s Expiry Date'));
  itd = itr.insertCell(-1);
  itd.style.height = '25px';
  input = document.createElement('input');
  input.type = 'text';
  input.style.width = '260px';
  input.id = this._unique + '_visa_date_expiry_current_date';
  itd.appendChild(input);
  
  itr = itable.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.style.padding = '5px 10px';
  itd.style.textAlign = 'right';
  itd.style.verticalAlign = 'top';
  itd.appendChild(document.createTextNode('Conviction Records'));
  itd = itr.insertCell(-1);
  itd.style.height = '60px';
  input = document.createElement('textarea');
  input.style.width = '260px';
  input.id = this._unique + '_record_conviction_text';
  itd.appendChild(input);
  
  itr = itable.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.style.padding = '5px 10px';
  itd.style.textAlign = 'right';
  itd.style.verticalAlign = 'top';
  itd.appendChild(document.createTextNode('Visa Refuse Cecords'));
  itd = itr.insertCell(-1);
  itd.style.height = '60px';
  input = document.createElement('textarea');
  input.style.width = '260px';
  input.id = this._unique + '_record_refuse_text';
  itd.appendChild(input);
  
  td = tr.insertCell(-1);
  td.style.verticalAlign = 'top';
  
  itable = document.createElement('table');
  itable.cellPadding = 0;
  itable.cellSpacing = 0;
  itable.style.fontWeight = 'bold';
  td.appendChild(itable);
  
  itr = itable.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.style.width = '200px';
  itd.style.padding = '6px 10px';
  itd.style.textAlign = 'right';
  itd.appendChild(document.createTextNode('Visa Type'));
  itd = itr.insertCell(-1);
  itd.style.height = '25px';
  input = document.createElement('input');
  input.type = 'text';
  input.style.width = '260px';
  input.id = this._unique + '_visa_appl_type_text';
  itd.appendChild(input);
  
  itr = itable.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.style.padding = '6px 10px';
  itd.style.textAlign = 'right';
  itd.appendChild(document.createTextNode('Submit Date'));
  itd = itr.insertCell(-1);
  itd.style.height = '25px';
  input = document.createElement('input');
  input.type = 'text';
  input.style.width = '260px';
  input.id = this._unique + '_visa_appl_date_submit_date';
  itd.appendChild(input);
  
  itr = itable.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.style.padding = '5px 10px';
  itd.style.textAlign = 'right';
  itd.appendChild(document.createTextNode('Medical Submit Time'));
  itd = itr.insertCell(-1);
  itd.style.height = '25px';
  input = document.createElement('select');
  input.style.width = '105px';
  input.style.margin = '0 5px 0 0';
  input.id = this._unique + '_medical_month_select';
  itd.appendChild(input);
  input = document.createElement('select');
  input.style.width = '155px';
  input.id = this._unique + '_medical_year_select';
  itd.appendChild(input);
  
  itr = itable.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.style.padding = '5px 10px';
  itd.style.textAlign = 'right';
  itd.appendChild(document.createTextNode('PCC Submit Time'));
  itd = itr.insertCell(-1);
  itd.style.height = '25px';
  input = document.createElement('select');
  input.style.width = '105px';
  input.style.margin = '0 5px 0 0';
  input.id = this._unique + '_pcc_month_select';
  itd.appendChild(input);
  input = document.createElement('select');
  input.style.width = '155px';
  input.id = this._unique + '_pcc_year_select';
  itd.appendChild(input);
  
  itr = itable.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.style.padding = '6px 10px';
  itd.style.textAlign = 'right';
  itd.appendChild(document.createTextNode('Scanned Documents'));
  itd = itr.insertCell(-1);
  itd.id = this._unique + '_docs_div';
  
  itr = itable.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.colSpan = 2;
  var iitable = document.createElement('table');
  iitable.id = this._unique + '_docs_read_table';
  iitable.style.fontSize = '13px';
  iitable.style.fontWeight = 'normal';
  iitable.style.padding = '0 0 0 80px';
  itd.appendChild(iitable);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.verticalAlign = 'top';
  td.colSpan = 2;
  
  itable = document.createElement('table');
  itable.cellPadding = 0;
  itable.cellSpacing = 0;
  itable.style.fontWeight = 'bold';
  itable.style.margin = '1px 0 0 0';
  td.appendChild(itable);
  
  itr = itable.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.style.width = '170px';
  itd.style.padding = '5px 10px';
  itd.style.textAlign = 'right';
  itd.style.verticalAlign = 'top';
  itd.appendChild(document.createTextNode('File Note/Process Records'));
  input = document.createElement('input');
  input.type = 'submit';
  input.value = 'Add New Block'
  input.style.fontSize = '10px';
  input.id = this._unique + '_record_process_split_btn';
  itd.appendChild(input);
  
  itd = itr.insertCell(-1);
  itd.style.height = '90px';
  input = document.createElement('textarea');
  input.style.width = '750px';
  input.rows = 6;
  input.id = this._unique + '_record_process_text';
  itd.appendChild(input);
    
  var mode = (this._options && this._options.mode) ? this._options.mode : Constant.VISA_MODE_EXIST_POP;
  tr = table.insertRow(-1);
  tr.style.display = (mode == Constant.VISA_MODE_EXIST_POP || mode == Constant.VISA_MODE_EXIST_PAGE || mode == Constant.VISA_MODE_PLUS) ? 'table-row' : 'none';
  td = tr.insertCell(-1);
  td.style.verticalAlign = 'top';
  
  itable = document.createElement('table');
  itable.cellPadding = 0;
  itable.cellSpacing = 0;
  itable.style.fontWeight = 'bold';
  itable.style.margin = '30px 0 0 0';
  itable.style.color = '#b67208';
  itable.style.fontFamily = 'Trebuchet MS';
  itable.style.fontSize = '14px';
  td.appendChild(itable);
  
  itr = itable.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.style.width = '170px';
  itd.style.padding = '6px 10px';
  itd.style.textAlign = 'right';
  itd.appendChild(document.createTextNode('Visa Application No.'));
  itd = itr.insertCell(-1);
  itd.style.height = '25px';
  input = document.createElement('input');
  input.type = 'text';
  input.style.width = '260px';
  input.id = this._unique + '_visa_appl_num_text';
  itd.appendChild(input);
  
  itr = itable.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.style.padding = '6px 10px';
  itd.style.textAlign = 'right';
  itd.appendChild(document.createTextNode('Visa Issue Date'));
  itd = itr.insertCell(-1);
  itd.style.height = '25px';
  input = document.createElement('input');
  input.type = 'text';
  input.style.width = '260px';
  input.id = this._unique + '_visa_date_issue_date';
  itd.appendChild(input);
  
  itr = itable.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.style.width = '170px';
  itd.style.padding = '6px 10px';
  itd.style.textAlign = 'right';
  itd.appendChild(document.createTextNode('New Visa’s Expiry Date'));
  itd = itr.insertCell(-1);
  itd.style.height = '25px';
  input = document.createElement('input');
  input.type = 'text';
  input.style.width = '260px';
  input.id = this._unique + '_visa_date_expiry_new_date';
  itd.appendChild(input);
  
  td = tr.insertCell(-1);
  td.style.verticalAlign = 'top';
  
  
  itable = document.createElement('table');
  itable.cellPadding = 0;
  itable.cellSpacing = 0;
  itable.style.fontWeight = 'bold';
  itable.style.margin = '30px 0 0 0';
  itable.style.color = '#b67208';
  itable.style.fontFamily = 'Trebuchet MS';
  itable.style.fontSize = '14px';
  td.appendChild(itable);
  
  itr = itable.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.style.width = '200px';
  itd.style.padding = '6px 10px';
  itd.style.textAlign = 'right';
  itd.appendChild(document.createTextNode('Visa Result'));
  itd = itr.insertCell(-1);
  itd.style.height = '25px';
  input = document.createElement('select');
  input.style.width = '265px';
  input.id = this._unique + '_visa_result_select';
  itd.appendChild(input);
  
  itr = itable.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.style.padding = '6px 10px';
  itd.style.textAlign = 'right';
  itd.appendChild(document.createTextNode('Visa Pickup Date'));
  itd = itr.insertCell(-1);
  itd.style.height = '25px';
  input = document.createElement('input');
  input.type = 'text';
  input.style.width = '260px';
  input.id = this._unique + '_visa_date_pickup_date';
  itd.appendChild(input);
  
  itr = itable.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.style.padding = '6px 10px';
  itd.style.textAlign = 'right';
  itd.appendChild(document.createTextNode('Scanned Visa Label'));
  itd = itr.insertCell(-1);
  itd.id = this._unique + '_visa_div';
  
  itr = itable.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.colSpan = 2;
  var iitable = document.createElement('table');
  iitable.id = this._unique + '_visa_read_table';
  iitable.style.fontSize = '13px';
  iitable.style.fontWeight = 'normal';
  iitable.style.padding = '0 0 0 80px';
  itd.appendChild(iitable);
  
  tr = table.insertRow(-1);
  tr.style.display = (mode == Constant.VISA_MODE_PLUS) ? 'none' : 'table-row';
  td = tr.insertCell(-1);
  td.colSpan = 2;
  td.style.verticalAlign = 'top';
  td.style.textAlign = 'right';
  input = document.createElement('input');
  input.type = 'submit';
  input.value = 'Save';
  input.style.margin = '20px 0 0 0';
  input.id = this._unique + '_save_btn';
  input.className = 'button';
  td.appendChild(input);
  
  input = document.createElement('input');
  input.type = 'submit';
  input.value = 'Cancel';
  input.style.display = (mode == Constant.VISA_MODE_NEW_POP || mode == Constant.VISA_MODE_EXIST_POP) ? 'inline' : 'none';
  input.style.margin = '20px 20px 20px 2px';
  input.id = this._unique + '_cancel_btn';
  input.className = 'button';
  td.appendChild(input);
};